<template>
  <!-- 数值（digitsFraction小数位数）-->
  <el-input-number
    v-if="props.columnData.fieldTypeCode == 'NUMBER'"
    style="width: 100%"
    v-model.trim="props.itemData[props.columnData.fieldCode]"
    :disabled="props.columnData.disabled"
    :precision="props.columnData.digitsFraction ? props.columnData.digitsFraction : 0"
    :max="props.columnData.maxNumber ? props.columnData.maxNumber : Infinity"
    :min="props.columnData.minNumber || props.columnData.minNumber == 0 ? props.columnData.minNumber : -Infinity"
    @blur="handelBlur"
    @change="handelChange"
    clearable
  />
</template>

<script setup>
import { ref, reactive, computed } from 'vue'
import { mixinsData } from '../hooks/mixinsData'

const props = defineProps({
  columnData: {
    type: Object,
    default: () => {}
  },
  itemData: {
    type: Object,
    default: () => {}
  },
  rules: {
    type: Object,
    default: () => {}
  }
})

const { handelBlur, handelChange } = mixinsData(props.columnData, props.itemData, props.rules)
</script>
<style lang="scss"></style>
